package cn.itcast.web.mq;

import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.Map;

@Component
public class MailProducer {

	@Autowired
	private RabbitTemplate rabbitTemplate;

	/**
	 * 发送邮件
	 *  to
	 *  subject
	 *  content
	 *   convertAndSend :
	 *      将传输的数据根据类型转化器转化
	 *
	 */
	public void send(Map map) {
		rabbitTemplate.convertAndSend("user.insert",map);
	}
}
